<?php

/**
 * Library :: DAL (Data Access Layer) :: DataObject
 *
 * Warlock is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 *
 * @package    warlock
 * @author     David Cole <neophyte@sourcetutor.com>
 * @license    GNU/GPL v2
 */

// Object Dependencies
using('Engine.DAL.DataObject');

class DAL_DataObject_profilefield extends DAL_DataObject
{
    function __construct()
    {
        parent::__construct();

        // Table Properties
        $this->Table      = 'w_engine_profile_fields';
        $this->PrimaryKey = 'id';

        // Field Definitions
        $this->Fields['id']           = array('type' => 'INTEGER', 'size' => '4', 'unsigned' => true, 'autoincrement' => true);
        $this->Fields['type']         = array('type' => 'STRING', 'size' => '40');
        $this->Fields['weight']       = array('type' => 'INTEGER', 'size' => '2', 'unsigned' => true);
        $this->Fields['page']         = array('type' => 'STRING', 'size' => '255');
        $this->Fields['category']     = array('type' => 'STRING', 'size' => '255');
        $this->Fields['name']         = array('type' => 'STRING', 'size' => '40');
        $this->Fields['title']        = array('type' => 'STRING', 'size' => '64');
        $this->Fields['description']  = array('type' => 'STRING', 'size' => '255');
        $this->Fields['visibility']   = array('type' => 'BOOLEAN', 'true' => 'Y', 'false' => 'N');
        $this->Fields['required']     = array('type' => 'BOOLEAN', 'true' => 'Y', 'false' => 'N');

        /*
         * Data Object Relationships
         */

        $this->Relationships[] = array('table'  => 'w_engine_profile_values',
                                       'do'     => 'profile',
                                       'type'   => 'CASCADE',
                                       'relate' => array('id' => 'fid'));
    }
}

?>